package com.lanou.zakerproject.community;

import android.content.Intent;
import android.os.Bundle;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import com.lanou.zakerproject.R;
import com.lanou.zakerproject.base.BaseActivity;

/**
 * Created by dllo on 16/1/20.
 */
public class CommunityShowActivity extends BaseActivity {
    private WebView webView;
    private String URL;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_show_community);
        webView = (WebView) findViewById(R.id.show_community_webview);
        webView.getSettings().setJavaScriptEnabled(true);
        Intent intent = getIntent();
        URL = intent.getStringExtra("ShowDetailUrl");
        //加载需要显示的网页
        webView.loadUrl(URL);
        webView.setWebViewClient(new WebViewClient() {
            //  重写此方法表明点击网页里面的链接还是在当前的webview里跳转，不跳到浏览器那边
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                view.loadUrl(url);
                return true;
            }
        });
    }
}
